<script setup>
import { onMounted, onUnmounted } from "vue";
import AMapLoader from "@amap/amap-jsapi-loader";

let map = null;

onMounted(() => {
  AMapLoader.load({
    key: "59c7d5093b5f8614cb2661f7d417f70e", 
    version: "1.0",
    plugins: [], 
  })
    .then((AMap) => {
      map = new AMap.Map("container", {
     
        viewMode: "3D", 
        zoom: 11,
        center: [116.397428, 39.90923], 
      });
    })
    .catch((e) => {
      console.log(e);
    });
});

onUnmounted(() => {
  map?.destroy();
});
</script>

<template>
  <div id="container"></div>
</template>

<style scoped>
#container {
  width: 100%;
  height: 800px;
}
</style>
